<template>
  <div class="my-domain-table-tool">
    <div class="btn" @click="clickEvent(6)">
      详情
    </div>
    <div class="btn"  @click="clickEvent(0)"
         v-if="(domainInfo.auditType !== 1 || domainInfo.auditStatus === 2)
         && !(domainInfo.tradingStatus === 2 || domainInfo.tradingStatus === 3)
         && domainInfo.status !== 5 && domainInfo.status !== 6">
      续费
    </div>
<!--    <div class="btn"  @click="clickEvent(1)"
         v-if="domainInfo.isPush === 1
         && (domainInfo.auditType !== 1 || domainInfo.auditStatus === 2)
         && !(domainInfo.status === 4 || domainInfo.status === 5 || domainInfo.status === 6)
         && !(domainInfo.tradingStatus === 2)
         && domainInfo.dnsPlatform !== 1">
      解析
    </div>
    <div class="btn" @click="clickEvent(2)"
         v-if="domainInfo.isPush === 1
         && (domainInfo.auditType !== 1 || domainInfo.auditStatus === 2)
         && !(domainInfo.status === 4 || domainInfo.status === 5 || domainInfo.status === 6)
         && !(domainInfo.tradingStatus === 2)">
      DNS
    </div>-->
    <div class="btn" @click="clickEvent(3)"
         v-if="domainInfo.isPush === 1
         && domainInfo.isLock !== 1
         && (domainInfo.auditType !== 1 || domainInfo.auditStatus === 2)
         && !(domainInfo.status === 4 || domainInfo.status === 5 || domainInfo.status === 6)
         && !(domainInfo.tradingStatus === 2)">
      PUSH
    </div>
    <div class="btn" @click="clickEvent(4)"
         v-if="(domainInfo.auditType !== 1 || domainInfo.auditStatus === 2)
         && !(domainInfo.status === 4 || domainInfo.status === 5 || domainInfo.status === 6)
         && !(domainInfo.tradingStatus === 2)">
      模板过户
    </div>
    <div class="btn" @click="clickEvent(5)"
         v-if="domainInfo.isPush === 1
         && domainInfo.isLock !== 1
         && (domainInfo.auditType !== 1 || domainInfo.auditStatus === 2)
         && !(domainInfo.status === 4 || domainInfo.status === 5 || domainInfo.status === 6)
         && (domainInfo.tradingStatus === 0)">
      出售
    </div>

    <div class="btn" @click="clickEvent(7)"
         v-if="domainInfo.isPush === 1
         && (domainInfo.auditType !== 1 || domainInfo.auditStatus === 2)
         && (domainInfo.status === 5 || domainInfo.status === 6)">
      赎回
    </div>
<!--    <div class="btn">
      <Dropdown
        placement="left-start"
        :transfer="true"
        @on-click="dropdownEvent"
      >
        <span>更多</span>
        <DropdownMenu slot="list">
          <DropdownItem :disabled="isDisable" :name="3">PUSH</DropdownItem>
          <DropdownItem :disabled="isDisable" :name="4">模板过户</DropdownItem>
          <DropdownItem :disabled="isDisable" :name="5">出售</DropdownItem>
          <DropdownItem :name="6">域名详情</DropdownItem>
          <DropdownItem v-if="status === 5" :name="7">赎回</DropdownItem>
          <DropdownItem v-if="status === 6" :disabled="isDisable" :name="8"
            >赎回中</DropdownItem
          >
          <DropdownItem v-if="renewDisable" :name="9"
            >设置自动续费</DropdownItem
          >
          <DropdownItem v-if="isAutoRenew === 1" :name="10"
            >取消自动续费</DropdownItem
          >
        </DropdownMenu>
      </Dropdown>
    </div>-->
  </div>
</template>
<script>
export default {
  name: "myDomainTableTool",
  props: {
    domainInfo: {
      type: Object,
      default: () => {},
    }
  },
  computed: {
    colors() {
      return !this.disable && this.status !== 5 && this.status !== 6
        ? "color:$mainColor;"
        : "color:#666;";
    },
    disableColor() {
      return this.status === 5 || this.status === 6
        ? "color:#666;"
        : "color:$mainColor;";
    },
    isDisable() {
      return this.status === 5 || this.status === 6;
    },
    renewDisable() {
      return (
        this.status !== 2 &&
        this.status !== 5 &&
        this.status !== 6 &&
        this.isAutoRenew === 0
      );
    },
  },
  data() {
    return {};
  },
  methods: {
    clickEvent(val) {
      this.$emit("clickEvent", val);
    },
    dropdownEvent(val) {
      this.$emit("clickEvent", val);
    },
  },
};
</script>
<style lang="scss" scoped>
.my-domain-table-tool {
  justify-content: space-between;
  align-items: center;
  .btn {
    display: inline-block;
    padding: 0 5px;
    cursor: pointer;
    color: $mainColor;
    &.disable{
      color: #666666;
      cursor: not-allowed;
    }
  }
}
</style>
